package com.dds.system.service.sys.impl;

import java.util.List;
import com.dds.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dds.system.mapper.sys.SysDicCategoryMapper;
import com.dds.system.domain.sys.SysDicCategory;
import com.dds.system.service.sys.ISysDicCategoryService;

/**
 * 数据字典分类Service业务层处理
 * 
 * @author gaolianjie
 * @date 2021-04-12
 */
@Service
public class SysDicCategoryServiceImpl implements ISysDicCategoryService 
{
    @Autowired
    private SysDicCategoryMapper sysDicCategoryMapper;

    /**
     * 查询数据字典分类
     * 
     * @param categoryId 数据字典分类ID
     * @return 数据字典分类
     */
    @Override
    public SysDicCategory selectSysDicCategoryById(Long categoryId)
    {
        return sysDicCategoryMapper.selectSysDicCategoryById(categoryId);
    }

    /**
     * 查询数据字典分类列表
     * 
     * @param sysDicCategory 数据字典分类
     * @return 数据字典分类
     */
    @Override
    public List<SysDicCategory> selectSysDicCategoryList(SysDicCategory sysDicCategory)
    {
        return sysDicCategoryMapper.selectSysDicCategoryList(sysDicCategory);
    }

    /**
     * 新增数据字典分类
     * 
     * @param sysDicCategory 数据字典分类
     * @return 结果
     */
    @Override
    public int insertSysDicCategory(SysDicCategory sysDicCategory, Long userId)
    {
        sysDicCategory.setCreateuser(userId);
        sysDicCategory.setCreatetime(DateUtils.getNowDate());
        return sysDicCategoryMapper.insertSysDicCategory(sysDicCategory);
    }

    /**
     * 修改数据字典分类
     * 
     * @param sysDicCategory 数据字典分类
     * @return 结果
     */
    @Override
    public int updateSysDicCategory(SysDicCategory sysDicCategory)
    {
        sysDicCategory.setUpdateTime(DateUtils.getNowDate());
        return sysDicCategoryMapper.updateSysDicCategory(sysDicCategory);
    }

    /**
     * 批量删除数据字典分类
     * 
     * @param categoryIds 需要删除的数据字典分类ID
     * @return 结果
     */
    @Override
    public int deleteSysDicCategoryByIds(Long[] categoryIds)
    {
        return sysDicCategoryMapper.deleteSysDicCategoryByIds(categoryIds);
    }

    /**
     * 删除数据字典分类信息
     * 
     * @param categoryId 数据字典分类ID
     * @return 结果
     */
    @Override
    public int deleteSysDicCategoryById(Long categoryId)
    {
        return sysDicCategoryMapper.deleteSysDicCategoryById(categoryId);
    }
}
